/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package be.djdb.shop;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.validation.constraints.Min;

/**
* @author Lieven Roegiers
* @copyright 2013
* @from MY_SHOP
*/
@Entity
public class Category implements Serializable{
    @Id @GeneratedValue(generator = "CATEGORY_ID")
    @Min(value = 1, message = "a Category's id must be greater than zero")
    private int id;
    @OneToMany
    private transient List<Product> w;//transient wil not serialise the object
    private String name;
    private String type;
    public String getName() {
        return name;
    }
    public int getId(){
        return id;
    }
    public void setCategoryName(String categoryName) {
        this.name = name;
    }
}
